// 采购类型
export const TYPE_OPTIONS = [
  { label: '集采', value: 1 },
  { label: '区采', value: 2 },
  { label: '分采', value: 3 }
]
export const initFormItemList = (areaList) => {
  return [
    {
      prop: 'categoryName',
      label: '分类名称',
      type: 'input'
    },
    {
      prop: 'purchaseType',
      label: '采购类型',
      type: 'select',
      options: TYPE_OPTIONS
    },
    {
      prop: 'brandName',
      label: '品牌',
      type: 'input'
    },
    {
      prop: 'submitName',
      label: '提交人',
      type: 'input'
    },
    {
      prop: 'submitTime',
      label: '提交时间',
      type: 'datePicker',
      dataPickerType: 'daterange',
      valueFormat: 'yyyy-MM-dd'
    },
    {
      prop: 'areaId',
      label: '区域名称',
      type: 'select',
      options: areaList
    },
    {
      prop: 'hrDeptName',
      label: '部门名称',
      type: 'input',
    },
  ]
}
export const TABLE_COLUMNS = [
  {
    title: '品类树',
    key: 'fullPath',
    width: 120
  },
  {
    title: '分类名称',
    key: 'categoryName',
    width: 80
  },
  {
    title: '分类代码',
    key: 'categoryCode',
  },
  {
    title: '品牌ID',
    key: 'brandId',
  },
  {
    title: '品牌名称',
    key: 'brandName',
  },
  {
    title: '区域名称',
    key: 'areaName',
  },
  {
    title: '部门名称',
    key: 'hrDeptName',
  },
  {
    title: '采购类型',
    key: 'purchaseTypeStr',
  },
  {
    title: '提交人',
    key: 'submitName',
  },
  {
    title: '提交部门',
    key: 'submitDeptName',
  },
  {
    title: '提交时间',
    key: 'submitTime',
  },
]
export const ERRORS_COLUMN = {
  title: '异常原因',
  key: 'errorMsg',
  fixed: 'left',
  width: '130',
  errorTip: true,
  notShowTip: true,
}

// 查看采购类型
export const VIEW_TABLE_CLOUMNS = [
  {
    title: '品类树',
    key: 'fullPath',
    width: 100
  },
  {
    title: '分类名称',
    key: 'categoryName',
  },
  {
    title: '分类代码',
    key: 'categoryCode',
  },
  {
    title: '品牌ID',
    key: 'brandId',
  },
  {
    title: '品牌名称',
    key: 'brandName',
  },
  {
    title: '区域名称',
    key: 'areaName',
    children: [
      {
        title: '原值',
        key: 'areaNameOld',
      },
      {
        title: '现值',
        key: 'areaName',
      }
    ]
  },
  {
    title: '部门名称',
    key: 'hrDeptName',
    children: [
      {
        title: '原值',
        key: 'hrDeptNameOld',
      },
      {
        title: '现值',
        key: 'hrDeptName',
      }
    ]
  },
  {
    title: '采购类型',
    key: 'purchaseTypeStr',
    children: [
      {
        title: '原值',
        key: 'purchaseTypeStrOld',
      },
      {
        title: '现值',
        key: 'purchaseTypeStr',
      }
    ]
  },
]
